package hdfs_pro;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
public class FileExist {
    public static void main(String[] args) {
        try {
              Configuration conf = new Configuration();
              FileSystem fs = FileSystem.get(conf);
              String fileName = args[0];
              if(fs.exists(new Path(fileName))) {
                    System.out.println("File Exists!");
              } else {
                    System.out.println("File not Exists!");
              }
        }catch(Exception e) {
              e.printStackTrace();
        }
    }
}